import request from '@/utils/request'

// 获取库房树
export function getTreeList() {
  return request({
    url:'/archive/storeRole/getTreeList',
    method: 'post',
  })
}

// 获取库房信息列表
export function getStoreList(query) {
  return request({
    url: '/archive/store/list',
    method: 'get',
    params: query
  })
}

// 获取库房管理员
export function userList(query) {
  return request({
    url: '/archive/storeRole/userList',
    method: 'get',
    params: query
  })
}

// 新增库房信息
export function addStore(data) {
  return request({
    url: '/archive/store',
    method: 'post',
    data: data
  })
}

// 验证库房是否可修改
export function checkStore(storeId) {
  return request({
    url: '/archive/store/checkStore/'+storeId,
    method: 'get'
  })
}

// 获取库房详情
export function getStoreDetail(storeId) {
  return request({
    url: '/archive/store/'+storeId,
    method: 'get'
  })
}

// 修改库房信息
export function updateStore(data) {
  return request({
    url: '/archive/store',
    method: 'put',
    data: data
  })
}

// 删除库房信息
export function deleteStore(storeId) {
  return request({
    url: '/archive/store/'+storeId,
    method: 'delete'
  })
}

// 获取档案柜信息
export function getShelfList(query) {
  return request({
    url: '/archive/shelf/list',
    method: 'get',
    params: query
  })
}

// 档案柜新增
export function addShelf(data) {
  return request({
    url: '/archive/shelf',
    method: 'post',
    data: data
  })
}

// 校验档案柜是否可修改
export function checkShelf(shelfId) {
  return request({
    url: '/archive/shelf/checkShelf/'+shelfId,
    method: 'get'
  })
}

// 获取档案柜详情
export function getShelfDetail(shelfId) {
  return request({
    url: '/archive/shelf/'+shelfId,
    method: 'get'
  })
}

// 档案柜修改
export function updateShelf(data) {
  return request({
    url: '/archive/shelf',
    method: 'put',
    data: data
  })
}

// 档案柜删除
export function deleteShelf(shelfId) {
  return request({
    url: '/archive/shelf/'+shelfId,
    method: 'delete'
  })
}

// 获取档案格信息
export function getGridList(query) {
  return request({
    url: '/archive/shelf/getGridInfo',
    method: 'get',
    params: query
  })
}
